#ifndef MYWIDGET_H
    #define TEXT_COLOR_RED(STRING) "<font color=\"#FF359A\">" STRING "</font>" "<font color=white> </font>"
#define MYWIDGET_H

#include <QWidget>
#include "workthread.h"
#include <QThread>
#include <QTableWidgetItem>
QT_BEGIN_NAMESPACE
namespace Ui { class MyWidget; }
QT_END_NAMESPACE

class MyWidget : public QWidget
{
    Q_OBJECT
    QThread workerThread;
public:
    MyWidget(QWidget *parent = nullptr);
    ~MyWidget();

    void setInfo();
    void label_help_clicked();

signals:
    void sign_starWorkThread(QString map,QString w2l,QString whiteListFile,bool read_slk,bool del_lni);

protected:


public slots:


private slots:
    void sl_responseCount(int all,int script,int mdx,int pic,int usedMdx,int usedPic,int delMdx,int delPic);
    void sl_workOver(int );
    void sl_responseExeLog(QString);

    void on_btnReturn_clicked();



    void on_btn_whiteList_clicked();

    void on_btn_save_clicked();

    void on_checkBox_readSlk_stateChanged(int arg1);

    void on_checkBox_delLni_stateChanged(int arg1);

private:
    Ui::MyWidget *ui;

    int m_allFileCount = 0;
    int m_scriptFileCount = 0;
    int m_mdxFileCount = 0;
    int m_picFileCount = 0;
    int m_usedMdxFileCount = 0;
    int m_usedPicFileCount = 0;
    int m_delMdxFileCount = 0;
    int m_delPicFileCount = 0;
    float m_costTime = 0;
    QString m_war3MapFile;  //地图完整路径
    QString m_info ;
    QString m_w2lPath;
    QString m_whiteListFile; //白名单文件路径
    QStringList m_errorInfo;

    QStringList m_WhiteListMdxFile;
    QStringList m_WhiteListPicFile;
    QStringList m_WhiteListDir;
    bool m_read_slk = false;
    bool m_del_lni = false;
    bool m_isFirstUI=true;
    bool m_bDrag = false;

    WorkThread *worker = new WorkThread;
    int m_isWorkOver = 0; //0 未启动 1结束 2正在执行


    QList<QTableWidgetItem*> headerList;
    QList<QTableWidgetItem*> itemList;

    QPoint      m_mouseStartPoint;
    QPoint      m_windowTopLeftPoint;


    QTimer* m_timer;

    void showFirstUI(bool b);


    void dropEvent(QDropEvent *event);
    void dragEnterEvent(QDragEnterEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mousePressEvent(QMouseEvent *event);
    bool eventFilter(QObject * watched, QEvent * event);
    //void closeEvent(QCloseEvent *event);

};
#endif // MYWIDGET_H
